#include "MenuItem.h"


using namespace mega;
using namespace sf;


MenuItem::MenuItem(sf::RectangleShape _shape)
	: m_shape(_shape)
	, m_state(MenuItemState::Active)
{}


MenuItem::~MenuItem()
{}


void MenuItem::setText(const char * _text)
{
	m_text.setString(_text);
}


sf::FloatRect MenuItem::getGlobalBounds() const
{
	return m_shape.getGlobalBounds();
}


void MenuItem::move(const Position & _offset)
{
	GameObject::move(_offset);

	m_shape.move(_offset);
	m_text.move(_offset);
}


void MenuItem::render(mega::RenderTarget & _target)
{
	_target.draw(m_shape);
	_target.draw(m_text);
}